package com.robot.base.common.api;

import androidx.databinding.ObservableField;

import com.robot.base.model.CheckMobileBindThirdUidBean;
import com.robot.base.model.LoginBean;
import com.robot.base.model.RefreshTokenBean;
import com.robot.base.model.RibbonBean;
import com.robot.base.model.UserInfoBean;
import com.qihang.annotations.ApiFactory;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import com.robot.base.model.BaseResponse;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

@ApiFactory(value = GlBaseApi.class)
public interface UserService {

    //发送短信验证码
    @POST(" /app-api/app/account/auth/send-sms-code")
    Observable<BaseResponse<String>> sendSmsVerifyCode(@Body Map<String, Object> map);

    @Streaming
    @GET
    Observable<ResponseBody> dowloadApk(@Url String url);

    @POST("/app-api/app/account/auth/sms-login")
    Observable<BaseResponse<LoginBean>> smsLogin(@Body Map<String, Object> map);

    @POST("/app-api/app/account/auth/login")
    Observable<BaseResponse<LoginBean>> passwordLogin(@Body Map<String, Object> map);

    @POST("/app-api/app/account/auth/logout")
    Observable<BaseResponse<String>> logout();
    @GET("/app-api/app/account/users/userInfo")
    Observable<BaseResponse<UserInfoBean>> userInfo();

    @GET("/app-api/app/account/users/getOtherUser")
    Observable<BaseResponse<UserInfoBean>> otherUserInfo(@Query("id") String id);
    @POST("/app-api/app/account/auth/social-wechat-login")
    Observable<BaseResponse<LoginBean>> weChatLogin(@Body Map<String, Object> map);

    @POST("/app-api/app/account/auth/social-wechat-bind-openId-sms-login")
    Observable<BaseResponse<LoginBean>> weChatBindPhoneLogin(@Body Map<String, Object> map);

    @POST("/app-api/app/account/auth/social-wechat-bind-openId-up-login")
    Observable<BaseResponse<LoginBean>> weChatBindAccountLogin(@Body Map<String, Object> map);

    //手机统一登录，根据token获取手机号
    @POST("/app-api/app/account/auth/social-auth-token-phone")
    Observable<BaseResponse<LoginBean>> tokenPhone(@Body Map<String, Object> map);

    //APP根据Type类型功能区数据查询
    @GET("/app-api/app/infra/ribbon/getRibbonList")
    Observable<BaseResponse<List<RibbonBean>>> getRibbonList(@Query("type") int type);

    /**
     * 上传图片
     *
     * @param part path 文件名
     * @return
     */
    @Multipart
    @POST("/app-api/app/infra/file/upload")
    Observable<BaseResponse<String>> upload(@Part MultipartBody.Part part);

}
